/*
 * Logger.java
 * 
 * author: The MomberBan Team
 *    date: 21.09.2008
 * 
 * 
 */
package at.momberban.game.me;

/**
 * better than sysout
 * 
 * @author patchinsky
 */
public class Logger {
    /**
     * show messages
     */
    public static final int DEBUG = 0;

    /**
     * suppress message output
     */
    public static final int RELEASE = 1;

    private static int LOG_LEVEL = DEBUG;

    private static boolean IS_HOST = false;

    /**
     * @param level
     *            to set
     */
    public static final void setLogLevel(int level) {
        LOG_LEVEL = level;
    }

    /**
     * @param isHost
     */
    public static final void setIsHost(boolean isHost) {
        IS_HOST = isHost;
    }

    /**
     * log the message
     * 
     * @param msg
     */
    public static final void log(String msg) {
        if (LOG_LEVEL == DEBUG) {
            System.out.println((IS_HOST ? "HOST" : "CLIENT") + " "
                    + Thread.currentThread().getName() + ": " + msg);
        }
    }

}
